package org.smile.db.sql;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 语句方言
 */
public interface SQLHelper {

    StringBuilder getInsertSql(String table, Collection<String> names);

    StringBuilder getUpdateBaseSql(String tableName);

    StringBuilder getInsertSql(Collection<? extends Mapping> mappings, String table);

    StringBuilder getDeleteByIdSql(String tableName, String[] keyFileds);

    StringBuilder getUpdateAllSql(Collection<? extends Mapping> mappings, String tableName);

    StringBuilder getUpdateAllSql(String tableName, String[] names);

    StringBuilder getSelectAllSql(String tableName);

    StringBuilder getSelectSql(String tableName, String whereSql);

    StringBuilder getSelectSql(String tableName, String[] queryFields, String whereSql);

    StringBuilder getSelectSql(String tableName, String[] queryFields);

    void addKeyFieldWhere(StringBuilder sql, List<Object> params, Map<String, Object> fields, String[] keyFields);

    StringBuilder getUpdateSql(String tableName, String[] updateFields, String whereSql);

    StringBuilder getSelectByIdSql(String tableName, String[] keyFileds);

    String getSelectByIdSql(String tableName, String[] keyFields, String[] queryColumns);

    StringBuilder getSelectAllSql(String tableName, Collection<String> names);

    StringBuilder getUpdateAllSql(String tableName, Collection<String> names);

    StringBuilder getNamedUpdateSql(String tableName, String[] updateFields, String whereSql);

    StringBuilder getDeleteAllSql(String tableName);

    StringBuilder getCountSql(String tableName, String where);
}
